package org.samcolon.eeexplore.utils;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import com.alibaba.excel.EasyExcel;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @author: Sam.zhang
 * @date: 2021.07.22
 */
public class EeeMain {
    public static void main(String[] args) {

        List<List<String>> datas = CollUtil.newArrayList();
        List<String> data1 = CollUtil.newArrayList("1测试1", "1测试2", "ts111111t", "1测试4", "1测试5", "1测试6");
        datas.add(data1);
        List<String> data2 = CollUtil.newArrayList("2测试1", "2测试2", "awwww", "2测试4", "2测试5", "2测试6");
        datas.add(data2);
        List<String> data3 = CollUtil.newArrayList("3测试1", "3测试2", "t", "3测试4", "3测试5", "3测试6");
        datas.add(data3);

        List<List<String>> head = excelHead();
        File file = FileUtil.file(FileUtil.getUserHomeDir(), "test-2222-easyexcel.xlsx");
        EasyExcel.write(file).head(head).sheet("11111")
                //     .registerWriteHandler(StyleStrategy())
                //     .registerWriteHandler(new ReportMergeStrategy(devicecheck.size()))//自定义合并 单元格
                //     .registerWriteHandler(new RowWriteHandler())
                .doWrite(datas);
    }

    public static List<List<String>> excelHead() {
        List<List<String>> headList = new ArrayList();

        headList.add(CollUtil.newArrayList("区域"));
        headList.add(CollUtil.newArrayList("县市"));
        headList.add(CollUtil.newArrayList("店名"));
        headList.add(CollUtil.newArrayList("店招"));
        headList.add(CollUtil.newArrayList("店主姓名"));
        headList.add(CollUtil.newArrayList("中烟客户经理"));
        headList.add(CollUtil.newArrayList("市场代表"));
        headList.add(CollUtil.newArrayList("专卖许可证"));
        headList.add(CollUtil.newArrayList("客户编码"));
        headList.add(CollUtil.newArrayList("联系电话"));
        headList.add(CollUtil.newArrayList("手机"));
        headList.add(CollUtil.newArrayList("地址"));
        headList.add(CollUtil.newArrayList("展示设施", "前柜"));
        headList.add(CollUtil.newArrayList("展示设施", ""));
        headList.add(CollUtil.newArrayList("展示设施", "背柜"));
        headList.add(CollUtil.newArrayList("展示设施", ""));
        headList.add(CollUtil.newArrayList("展示设施", "背景墙"));
        headList.add(CollUtil.newArrayList("展示设施", "店招"));
        headList.add(CollUtil.newArrayList("展示设施", "货架"));
        headList.add(CollUtil.newArrayList("展示设施", "灯箱"));
        headList.add(CollUtil.newArrayList("留单内容"));
        headList.add(CollUtil.newArrayList("是否收到"));
        headList.add(CollUtil.newArrayList("资料与实际是否相符"));
        headList.add(CollUtil.newArrayList("展示设施（无论是否相符均需要填写具体数字）", "前柜"));
        headList.add(CollUtil.newArrayList("展示设施（无论是否相符均需要填写具体数字）", "背柜"));
        headList.add(CollUtil.newArrayList("展示设施（无论是否相符均需要填写具体数字）", "背景墙"));
        headList.add(CollUtil.newArrayList("展示设施（无论是否相符均需要填写具体数字）", "店招"));
        headList.add(CollUtil.newArrayList("展示设施（无论是否相符均需要填写具体数字）", "货架"));
        headList.add(CollUtil.newArrayList("展示设施（无论是否相符均需要填写具体数字）", "卡布灯箱"));
        headList.add(CollUtil.newArrayList("展示设施（无论是否相符均需要填写具体数字）", "酒柜"));
        headList.add(CollUtil.newArrayList("展示设施（无论是否相符均需要填写具体数字）", "收银台"));
        headList.add(CollUtil.newArrayList("展示设施（无论是否相符均需要填写具体数字）", "其他（此项写具体内容）"));
        headList.add(CollUtil.newArrayList("展示设施情况", "质量"));
        headList.add(CollUtil.newArrayList("展示设施情况", "是否有破损"));
        headList.add(CollUtil.newArrayList("对制作商服务的意见或建议"));
        headList.add(CollUtil.newArrayList("建议"));
        headList.add(CollUtil.newArrayList("其他"));
        headList.add(CollUtil.newArrayList("配合度"));

        return headList;
    }
}
